/*
  This file is part of 'Trivial chess'.

  'Trivial chess' is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  'Trivial chess' is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with 'Trivial chess'.  If not, see <http://www.gnu.org/licenses/>.
*/

/* SVN FILE: $Id$ */
/**
 * @author         $Author$
 * @version        $Rev$
 * @lastrevision   $Date$
 * @filesource     $URL$
 */

#include <iostream>
#include <sstream>
#include <algorithm>

#include "config.h"

#include "macros.h"

#include <boost/signal.hpp>
//#include <boost/bind.hpp>

struct HelloWorld
{
  void operator()() const
  {
    std::cout << "Hello, World!" << std::endl;
  }
};

template<int N = 0> struct test {

};



int main()
{

	Board board;
	//board.clean();
	//board.set(Square::D5(), Man::BLACK_QUEEN());
	board.fromStr("rnbqkbnr/Pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 3");

	Move move;
	move.fromStr("a7b8n");

	UnmakeMoveInfo info;
	MoveMaker::make(move, board, info);
	MoveMaker::unmake(board, info);

	//std::cout << board[Square::A2()];
	//Move move(Square::E2(), Square::E4());


	//board.set(Square::A1(), Man::BLACK_QUEEN());
/*
	for ( int j = 0; j < 5000000; ++j ) {
		board.clean();
	}

	int a = board[Square::A1()].toInt();
*/
/*
	boost::signal<void ()> signalSet;
	//signalSet.connect(HelloWorld());
	signalSet();
*/
/*
	int8_t board[8][8];
	for ( int j = 0; j < 5000000; ++j ) {
		for ( int f = 0; f < 8; ++f ) {
			for ( int r = 0; r < 8; ++r ) {
				board[f][r] = 12;
			}
		}
	}

	int a = board[0][0];

	Move p;

	std::cin >> p;
*/
	std::cout << board << std::endl;
/*
	int i = 0;
	for ( int j = 0; j < 5000000; ++j ) {
		Square s = Square::B2();
		const SquareVector v = SquareVector(FileScalar(i%3),RankScalar(1));
		do {
			++i;
		} while ( Square::NIL() != (s += v) );
	}
*/
/*
	int i = 0;
	for ( int j = 0; j < 5000000; ++j ) {
		int8_t f = 1;
		int8_t r = 1;
		const int8_t fs = i%3;
		const int8_t rs = 1;
		do {
			++i;
			f += fs;
			r += rs;
		} while ( f >= 0 && f < 8 && r >= 0 && r < 8 );
	}
*/
	//std::cout << i << std::endl;

}

